﻿

function DeleteSPWebsevice(id) {
    var answer = confirm('Bạn chắc chắn xóa sản phẩm này ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DeleteSP'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};


function capnhat_banchay(id) {

    var webMethod = '/WebService.asmx/BanChay'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function capnhat_khuyenmai(id) {

    var webMethod = '/WebService.asmx/KhuyenMai'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function capnhat_giamgia(id) {

    var webMethod = '/WebService.asmx/GiamGia'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};
function capnhat_sanphammoi(id) {

    var webMethod = '/WebService.asmx/SPMoi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function capnhat_hethang(id) {

    var webMethod = '/WebService.asmx/HetHang'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function capnhat_xuatbang(id) {

    var webMethod = '/WebService.asmx/XuatBang'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function capnhat_trangchu(id) {

    var webMethod = '/WebService.asmx/TrangChu'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};


//----------------------------Lap top-------------------------------------

function DeleteLaptopWebsevice(id) {
    var answer = confirm('Bạn chắc chắn xóa sản phẩm này ?')
    if (answer) {

        var webMethod = '/WebService.asmx/LapTop_DeleteSP'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};


function laptop_banchay(id) {

    var webMethod = '/WebService.asmx/LapTop_BanChay'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function laptop_khuyenmai(id) {

    var webMethod = '/WebService.asmx/LapTop_KhuyenMai'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function laptop_giamgia(id) {

    var webMethod = '/WebService.asmx/LapTop_GiamGia'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            alert("Cập nhập thành công");
        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};
function laptop_sanphammoi(id) {

    var webMethod = '/WebService.asmx/LapTop_SPMoi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function laptop_hethang(id) {

    var webMethod = '/WebService.asmx/LapTop_HetHang'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function laptop_xuatbang(id) {

    var webMethod = '/WebService.asmx/LapTop_XuatBang'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function laptop_trangchu(id) {

    var webMethod = '/WebService.asmx/LapTop_TrangChu'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

//-- End laptop



//----ONLINE=====================
function DeleteOnline(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/Online_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};
function online_trangchu(id) {

    var webMethod = '/WebService.asmx/Online_TrangChu'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};
//-- End SIM SO
//---lien ket con - menucon
function RaoVat_Delete(id) {
    var answer = confirm('Bạn chắc chắn xóa?')
    if (answer) {

        var webMethod = '/WebService.asmx/RaoVat_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

//----------TIN TỨC --------------

function tintuc_tinmoi(id) {

    var webMethod = '/WebService.asmx/TinTuc_TinMoi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};
function tintuc_HienThi(id) {

    var webMethod = '/WebService.asmx/TinTuc_HienThi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};


function TinTuc_Delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/TinTuc_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};


//----------LOAI TIN TỨC --------------


function loaitintuc_hienthi(id) {

    var webMethod = '/WebService.asmx/LoaiTinTuc_HienThi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};


function loaitintuc_delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/LoaiTinTuc_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};



//----------CHINH SÁCH CÔNG TY --------------


function CSCT_HienThi(id) {

    var webMethod = '/WebService.asmx/CSCT_HienThi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};


function CSCT_Delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/CSCT_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};


//----------LINH KIEN --------------

function linhkien_hienthi(id) {

    var webMethod = '/WebService.asmx/LinhKien_HienThi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};


function Delete_danhmuc(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DanhMuc_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

//----------LOẠI LAPTOP --------------

function loailaptop_hienthi(id) {

    var webMethod = '/WebService.asmx/LoaiLapTop_HienThi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};


function LoaiLapTop_Delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/LoaiLapTop_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

//----------MANG DIEN THOAI --------------

function mangdienthoai_hienthi(id) {

    var webMethod = '/WebService.asmx/MangDienThoai_HienThi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};


function MangDienThoai_Delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/MangDienThoai_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

//----------QUẢNG CÁO --------------

function quangcao_trangchu(id) {

    var webMethod = '/WebService.asmx/QuangCao_HienThi'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};


function quangcao_delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/QuangCao_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

/*===========SLIDER XML=====================*/

function HienThi_Slider(id) {

    var webMethod = '/WebService.asmx/HienThi_Slider'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function DeleteSlider(id) {
    var answer = confirm('Bạn chắc chắn xóa sản phẩm này ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DeleteSlider'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

function dangnhap() {
    var email = document.getElementById("username").value;
    var pass = document.getElementById("password").value;
    if (email == '') {
        alert("Chưa nhập Username");
        $("#username").focus();
    }
    else if (pass == '') {
        alert("Chưa nhập mật khẩu");
        $("#password").focus();

    }

    else {
        LoginAdmin(email, pass);
    }
}

function LoginAdmin(Username, Password) {
    var webMethod = '/WebService.asmx/LoginAdmin'
    var parameters = "{'Username':'" + Username + "','Password':'" + Password + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            if (msg.d == true) {
                window.location = "/admin/quantri";

            }
            else {

                alert("Đăng nhập không thành công");

            }
        }

    });
};

function logout() {
    var webMethod = '/WebService.asmx/LogoutAdmin'
    var parameters = "";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            if (msg.d == true) {
                window.location = "/admin/index";
            }
        }
    });
};
/*==============THANH VIEN=================*/
function DeleteThanhVien(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/ThanhVien_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

/*==============DonHANG=================*/
function DonHang_Delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DonHang_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

/*==============Nhat Ky Dat HANG=================*/
function DeleteNhatKy(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DeleteNhatKy'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};


function SanPhamChange() {
    var id = document.getElementById('ddlSanPham');
    
    GetSanPham(id.value);
}
function GetSanPham(MaSP) {

    var webMethod = '/WebService.asmx/GetSanPham'
    var parameters = "{'MaSP':'" + MaSP + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            //alert(msg.d);
            $("#GiaLe").empty().html(msg.d);
        },
        error: function (e) {
            $("#GiaLe").html("Unavailable");
        }
    });
};

//----------SLIDER --------------

function capnhat_hienthiSlider(id) {

    var webMethod = '/WebService.asmx/HienThiSlider'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function Delete_Slider(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DeleteSlider'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};


//----------LOGO --------------

function hienthi_Logo(id) {

    var webMethod = '/WebService.asmx/HienThiLogo'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
    
};

function Delete_Logo(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DeleteLogo'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

//----------LOGO --------------

function capnhat_hienthiBangGia(id) {

    var webMethod = '/WebService.asmx/HienThiBangGia'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });

};

function Delete_BangGia(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DeleteBangGia'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};



//----------Images san pham--------------

function HienThi_Images(id) {

    var webMethod = '/WebService.asmx/HienThi_Images'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function Delete_Images(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/Delete_Images'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

//----------Danh mục con-------------

function HienThi_DMCon(id) {

    var webMethod = '/WebService.asmx/HienThi_DanhMucCon'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });
};

function Delete_DMCon(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/Delete_DanhMucCon'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};

/*==============FORM LIÊN HỆ=================*/
function FormLienHe_Delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/FormLienHe_Delete'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};


//----------Banner --------------

function banner_hienthi(id) {

    var webMethod = '/WebService.asmx/HienThiBanner'
    var parameters = "{'id':'" + id + "'}";
    $.ajax({
        type: "POST",
        url: webMethod,
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {

        },
        error: function (e) {
            $("#errors").html("Unavailable");
        }
    });

};

function banner_delete(id) {
    var answer = confirm('Bạn chắc chắn xóa ?')
    if (answer) {

        var webMethod = '/WebService.asmx/DeleteBanner'
        var parameters = "{'id':'" + id + "'}";
        $.ajax({
            type: "POST",
            url: webMethod,
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                window.location.reload();
            }

        });
    }
};